import turtle
import time

t = turtle.Pen()

# t.circle(50)
#
# t.goto(0,-100)
# t.circle(200)
#
# t.goto(0,-200)
# t.circle(300)
#
# turtle.done()


# my_colors = ("red","green","yellow","black")
# t.width(4)
t.speed(0)
#
# for i in range(5):
#     t.goto(0,-i*10)
#     t.pendown()
#     t.color(my_colors[i%len(my_colors)])
#     t.circle(50+i*10)
# turtle.done()

#作业：画棋盘。思考：找两个点，goto 然后再找一个点
# t.penup()
# t.goto(-400,0)
# t.pendown()
# t.goto(200,0)
# t.penup()
# t.goto(-400, 10)
# t.pendown()
# t.goto(200,10)

width = 30
num = 18
x1 = [(-400,400),(-400+width*num,400)]
y1 = [(-400,400), (-400,400-width*num)]

print(x1)
print(y1)

start = time.time()
for i in range(0,19):
    t.penup()
    # t.goto(-400, i*10)
    t.goto(x1[0][0],x1[0][1]-30*i)
    t.pendown()
    # t.goto(200, i*10)
    t.goto(x1[1][0],x1[1][1]-30*i)
end = time.time()
print("耗时：{0}".format(end-start)) #1.2293391227722168


for j in range(0,19):
    t.penup()
    # t.goto(200 - j*10,180)
    t.goto(y1[0][0]+30*j,y1[0][1])
    t.pendown()
    # t.goto(200-j*10,0)
    t.goto(y1[0][0]+30*j, y1[1][1])

turtle.done()
